<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{{title}}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  {% include "common/cite-css.html" %}
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <!-- Navbar -->
    {% include "common/cite-navbar.html" %}
    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    {% include "common/cite-sidebar-main.html" %}

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0 text-dark">现阶段A股列表</h1>
                    </div><!-- /.col -->
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="#">Home</a></li>
                            <li class="breadcrumb-item active">现阶段A股列表</li>
                        </ol>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        <!-- /.content-header -->

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <table id="stock-info" class="table table-hover">
                                <thead>
                                <tr>
                                    {% for field in fields %}
                                    <th>{{field}}</th>
                                    {% endfor %}
                                    <th>日K</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for items in data_list %}
                                <tr>
                                    {% for data in items %}
                                    <td>{{data}}</td>
                                    {% endfor %}
                                    <td><a style="cursor: pointer;" onclick="to_k_daily(this)">查看</a></td>
                                </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <!-- /.content-wrapper -->

    <!-- footer -->
    {% include "common/cite-foot.html" %}

    <!-- Control Sidebar -->
    {% include "common/cite-sidebar-ctrl.html" %}
    <!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
</body>
{% include "common/cite-js.html" %}

<script type = "text/javascript">
    $(function () {
        $('#stock-info').DataTable({
            "paging": true,
            "lengthChange": true,
            "searching": true,
            "ordering": true,
            "info": true,
            "autoWidth": false
        });
    });
    function to_k_daily(element) {
        window.open("/stock/daily/"+element.parentNode.parentNode.firstElementChild.innerText, "_blank");
    }
</script>
</html>